/**
 * 
 */
$(function() {
	//初始化表格
	easyExt.initCaptionTreeGrid('#tg','/accountCaption/list'); 
	
	//删除实现
	$("#del").click(function(){
		var selRows=$('#tg').treegrid('getSelections');
		easyExt.delAC(selRows,'/accountCaption/delete',function(){
			$('#tg').treegrid('clearSelections');
			$('#tg').treegrid('reload'); 
		});
	});
	//添加实现
	$("#add").click(function(){
		easyExt.addAccountCaption('/accountCaption/add',function(){
			$('#tg').treegrid('reload'); 
		});
	});
	//修改实现
	$("#edit").click(function(){
		var selRows=$('#tg').treegrid('getSelections');
		easyExt.editAC(selRows,'/accountCaption/edit',function(){
			$('#tg').treegrid('clearSelections');
			$('#tg').treegrid('reload'); 
		});
	});
	//上级菜单
	$('#parent').combotree({
		width:150,
		method:'GET',
	    url: easyExt.url+'/accountCaption/getMenu',
	    animate:true
	}); 
});